package com.mindata.blockchain.common;

import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @author wuweifeng wrote on 2018/3/17.
 */
@Configuration
public class AppId {
    @Resource
    private SystemConfig systemConfig;

    public static String appIdValue;
    public static String nameValue;
    public static String listenIp;
    public static int listenPort;

    @PostConstruct
    public void init() {
        appIdValue = systemConfig.getAppId();
        nameValue = systemConfig.getName();
        listenIp = systemConfig.getIp();
        listenPort = systemConfig.getPort();
    }

    @Override
    public String toString() {
        return "AppId{" +
                "appId='" + appIdValue + '\'' +
                ", name='" + nameValue + '\'' +
                ", ip='" + listenIp + '\'' +
                ", port=" + listenPort +
                '}';
    }
}
